<?php
 /*
 *信息管理
 */

class Model_Message extends PhalApi_Model_NotORM {

   public function getNews($uid){
     return $this->getORM()
            ->select('ucid')
            ->where('uid',$uid)
            ->fetch();
   }

  public function huoNews($uid,$touid){
     $user= DI()->notorm->zixc_bikeshop_new;
     return $user->select('*')
                 ->where('uid',$uid)->and('mid',$touid)
                 ->fetch(); 
  }     


   public function  inMessage($data){
      $user= DI()->notorm->zixc_bikeshop_idea;
      $user->insert($data);
       $id = $user->insert_id();
      return $id; 
   }

 public function  inNews($data){
       $user= DI()->notorm->zixc_bikeshop_new;
       $user->insert($data);
       $id = $user->insert_id();
      return $id; 
   }
 
  public function delNew($pmid){
    $user= DI()->notorm->zixc_bikeshop_new;  
    return $user->where('pmids',$pmid)->delete();
  } 

   protected function getTableName($id) {
        
      return 'zixc_bikeshop_user';
    
    }

}
